package so.sao.code.service.domain;

import so.sao.code.service.domain.entity.CodeSupplierConfig;
import so.sao.sso.feign.dto.IsvUserDTO;

/**
 * 用户的基本包装。
 */
public class UserBaseInfoWrapper {

	private IsvUserDTO user;

	private String cloudPathKey;

	private CodeSupplierConfig constantConfig;

	private Long eseId;//供应商公司id

	private Long userId;//当前用户

	private Long companyId;//客户id
	
	private String terminal;//供应商公司终端。
	
	public void setUser(IsvUserDTO user) {
		this.user = user;
	}

	public String getCloudPathKey() {
		return cloudPathKey;
	}

	public void setCloudPathKey(String cloudPathKey) {
		this.cloudPathKey = cloudPathKey;
	}

	public CodeSupplierConfig getConstantConfig() {
		return constantConfig;
	}

	public void setConstantConfig(CodeSupplierConfig constantConfig) {
		this.constantConfig = constantConfig;
	}

	public Long getEseId() {
		
		if (user != null) {
			return user.getEseId();
		}
		return eseId;

	}

	public void setEseId(Long eseId) {
		this.eseId = eseId;
	}

	public Long getUserId() {
		if (user != null) {
			return user.getId();
		}
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getCompanyId() {
		
		if (user != null) {
			return user.getCompanyId();
		}
		if(constantConfig!=null){
			constantConfig.getCompanyId();
		}
		return companyId;
	}
	
	public void setCompanyId(Long companyId) {
		this.companyId = companyId;
	}

	public String getTerminal() {
		if (user != null) {
			return user.getTerminalId();
		}

		return terminal;
	}

	public void setTerminal(String terminal) {
		this.terminal = terminal;
	}

}
